package com.codeerror.demo.bean;

import com.codeerror.demo.util.DateUtil;
import com.codeerror.demo.util.FindDataUtil;

import org.litepal.LitePal;

import java.util.ArrayList;
import java.util.List;

/**
 * 待办集卡片
 */
public class TodoListBean extends CardBean{
    private long time;
    private String formattedTime;
    private List<TodoBean> todoList = new ArrayList<>(); // 每个卡片对应的待办事项

    public TodoListBean(String name, long time) {
        this.name = name;
        this.time = time;
        formattedTime = DateUtil.getFormattedTime(time);
    }

    public long getTime() {
        return time;
    }

    public List<TodoBean> getTodoList() {
        todoList.clear();
        todoList.addAll(FindDataUtil.getTodoData(time));
        return todoList;
    }

}
